home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Libraries
/
SAT 2.3.8
/
Demos
/
HeartQuest demo ƒ
/
gameGlobals.p
< prev
next >
Wrap
Text File
|
1996-05-23
|
4KB
|
177 lines
{=================================================}
{========= GameGlobals, globals for HeartQuest ============}
{=================================================}
{ Example file for Ingemars Sprite Animation Toolkit. }
{ © Ingemar Ragnemalm 1992 }
{ See doc files for legal terms for using this code. }
{ This file defines the resource numbers and global variables for HeartQuest.}
unit GameGlobals;
interface
uses
{$IFC UNDEFINED THINK_PASCAL}
Types, Quickdraw, Windows, Resources, Menus, ToolUtils, {}
TextUtils,
{$ENDC}
SAT;
const
{ Resource numbers}
fileMenuRes = 1002; { File menu }
editMenuRes = 1003; { Edit menu }
gameMenuRes = 1004; { Race menu }
highMenuRes = 1005; { Highscores menu }
aboutAlrt = 1000; { About box }
helpenemiesAlrt = 1001;{ Pictures of the enemies }
theHighRes = 263; { highscore window }
highDlog = 259; { highscore name dialog box }
{ File menu }
helpenemies = 1;
quit = 3;
{ Edit menu }
em_undo = 1;
em_cut = 3;
em_copy = 4;
em_paste = 5;
{ Game menu }
run = 1;
sound = 3;
macho = 5;
allowBG = 7;
fastAnimation = 8;
pause = 10;
abort = 11;
{ highscore menu }
showhs = 1;
clearhs = 3;
{ Game area size: }
xsize = 512 - 440; {Use offSizeH-xsize!}
{ysize = 320; {Full height - use offSizeV instead}
{Number of bonus objects to get a bonus level}
kBonusLevelTresh = 5;
{ Preference file description - see further scores.p! }
kPrefsFileName = 'HeartQuest Prefs';
kPrefCreator = 'AHjD';
kPrefType = 'pref';
type
{ EventPtr = ^EventRecord;}
str15 = string[15];
featRec = record
sound: boolean;
allowBG: boolean;
plotFast: boolean;
macho: boolean;
player: str15;
end;
featPtr = ^featRec;
featHnd = ^featPtr;
{Indexes for strings}
const
aboutStrID = 1;
anonymousStrID = 2;
cantfindsysStrID = 3;
resmissingStrID = 4;
creatingprefStrID = 5;
cantcreateresStrID = 6;
cantopenprefStrID = 7;
cantcreateprefStrID = 8;
normalStrID = 9;
machoStrID = 10;
scoreStrID = 11;
bonusStrID = 12;
levelStrID = 13;
sureStrID = 14;
nobodyStrID = 15;
startgameStrID = 16;
startlevelStrID = 17;
pauseStrID = 18;
resumeStrID = 19;
nopictStrID = 20;
noclutStrID = 21;
nooffscreenStrID = 22;
pleaseuncheckStrID = 23;
endStrID = 24;
okStrID = 25;
yesStrID = 26;
noStrID = 27;
quitStrID = 28;
memerrStrID = 29;
noscreenStrID = 30;
satnopictStrID = 31;
nowindStrID = 32;
startbonusStrID = 33;
loadingStrID = 34;
var
theHigh: WindowPtr; { Window ptrs. }
{ Menu handles. There isn't any apple menu here, since TransSkel will}
{ be told to handle it itself.}
features: featHnd; { Settings record. }
fileMenu, editMenu, GameMenu, highMenu: MenuHandle;
{ Dummy Boolean. This may be used for Memory Management, if desired }
dummy: Boolean;
slask: OSerr;
level: longint;
bonus: longint;
playerPos: point; { Position of player, to make it possible for monsters to aim }
pauseFlag: boolean;
{New booleans for deciding when a level is completed, and whether there is a bonus object active or not.}
levelCompleted, bonusObjectRunning: Boolean;
{Variables for handling bonus levels. I havn't decided if gotAllBonuses should be used for anything.}
bonusLevelRunning, gotAllBonuses: Boolean;
bonusesCollected: integer;
lastMacho: Boolean; {features^^.macho förra game over}
lastHigh: Integer; {Platsen för förra highscore}
fadeTo: RGBColor; {Global color for CLUT fading}
gAppFile, gPrefFile: Integer; {Resource files}
function MyGetIndString (index: integer): Str255;
implementation
{I know, it's ugly to have a routine in the globals file, but this is needed just}
{about everywhere, so the alternative was to make a new unit.}
{MyGetIndString returns a string that it gets from STR# 128 (hard-coded)}
{by GetIndString.}
function MyGetIndString (index: integer): Str255;
var
str: Str255;
begin
GetIndString(str, 128, index);
MyGetIndString := str;
end;
end.